import Vue from 'vue';
import Dialog from "@/components/Dialog/Dialog.vue";

/**
 *
 * @param contentCmp  内容组件
 */
export function showDialog(contentCmp) {
	const DialogCtor =  Vue.extend(Dialog);
	const dialogComp = new DialogCtor().$mount();

	const ContentCmpCtor = Vue.extend(contentCmp);
	const ctComp = new ContentCmpCtor().$mount();
	let contentDom = dialogComp.$el.querySelector(".content");
	contentDom.appendChild(ctComp.$el);
	dialogComp.show();
	document.body.appendChild(dialogComp.$el);
}